<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body></body>
  <script>
    /* 
        
    */
    let obj = { name: "zs", firend: { name: "ls" } };
    // 对obj进行浅复制
    let obj2 = Object.assign({}, obj);

    // 对obj进行深复制
    let obj3 = JSON.parse(JSON.stringify(obj));
  </script>
</html>
